
<template>
<!--  <view>
   <view v-for="(card, index) in bankCards" :key="index">
   
     <view>银行卡号：{{ card.accountnumber }}</view>
     <view>支行名称：{{ card.bankforkname }}</view>
     <view>银行名称：{{ card.bankname }}</view>
   ------------------------------------------
     </view>

	<u-button type="success" @click="addbank">添加银行卡</u-button>
  </view> -->
</template>
<script>
// import token from '@/common/token/token.js'
	
export default {
	
  data() {
	
    return {
		
      bankCards: {} ,// 银行卡信息数组
	  form:{
		  id:'0'
	  }
    };
  },
  methods: {
    fetchBankCards() {
			 console.log("id----"+uni.getStorageSync('userid'));
			
			this.$api({
			  method: 'post',
			  url: '/system/userbankinfo/getAccountByIdName',
			  data: this.form,
			
			}).then(res => {
				// console.log(res.data);
			  this.bankCards = res.data;
			  console.log(this.bankCards);
			}).catch(err => {
			  console.log(err);
			});
			 
    },
	addbank(){
		uni.navigateTo({
			url:"/pages/user/my_bank_card/addbank/addbank",
			
		})
	}
  },
  mounted() {
	this.form.id = uni.getStorageSync('userid');
    // 在组件加载完成后调用fetchBankCards方法获取数据
    this.fetchBankCards();
  }
};
</script>

<style lang="scss">
	
</style>
